{layout name="../common/master"/}
<div id="right">
  <h4>
      <div class="btn-group">
          <a href="{:URL('home/Coupon/toUser')}" class="btn btn-success">返回</a>
          <button id="extend" type="submit" class="btn btn-info">导出到EXCEL</button>
      </div>
  </h4>
    <div class="panel panel-default col-lg-4">
        <div class="panel-heading">
            <h3 class="panel-title">优惠券信息</h3>
        </div>
        <div class="panel-body">
            <table class="table table-hover table-bordered">
                <tbody>
                <tr>
                    <th>优惠券ID</th>
                    <td>{$data['content']->coupon->id}</td>
                </tr>
                <tr>
                    <th>优惠券名称</th>
                    <td>{$data['content']->coupon->name}</td>
                </tr>
                <tr>
                    <th>金额</th>
                    <td>{$data['content']->coupon->bonus}</td>
                </tr>
                <tr>
                    <th>使用产品类型</th>
                    <td>{$data['content']->coupon->attachedProductType}</td>
                </tr>
                <tr>
                    <th>类型</th>
                    <td>{$data['content']->coupon->type}</td>
                </tr>
                <tr>
                    <th>上限金额</th>
                    <td>{$data['content']->coupon->upperAmount}</td>
                </tr>
                <tr>
                    <th>下限金额</th>
                    <td>{$data['content']->coupon->downAmount}</td>
                </tr>
                <tr>
                    <th>适用开始时间</th>
                    <td>{:date('Y-m-d H:i:s',$data['content']->coupon->use_start_time/1000)}</td>
                </tr>

                <tr>
                    <th>适用结束时间</th>
                    <td>{:date('Y-m-d H:i:s',$data['content']->coupon->use_end_time/1000)}</td>
                </tr>
                <tr>
                    <th>平台</th>
                    <td>{$data['content']->coupon->platFormID}</td>
                </tr>
                <tr>
                    <th>状态</th>
                    <td>{$data['content']->coupon->status}</td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
<div class="panel panel-default col-lg-8">
        <div class="panel-heading">
            <h3 class="panel-title">优惠券信息</h3>
        </div>
        <div class="panel-body">
            <table class="table table-hover table-bordered">
                <tbody>
                <tr>
                    <th>用户电话</th>
                    <th>性别</th>
                    <th>年龄</th>
                    <th>注册时间</th>
                </tr>
                {foreach name="user" item="vo" key="k"}
                <tr>
                    <th>{:isset($vo->userPhone)?$vo->userPhone:""}</th>
                    <th>{:isset($vo->gender)?$vo->gender:""}</th>
                    <th>{:isset($vo->age)?$vo->age:""}</th>
                    <th>{:isset($vo->create_time)?$vo->create_time:""}</th>
                </tr>
                {/foreach}
                </tbody>
            </table>
        </div>
    </div>


</div>
<script>
    $("#extend").click(function () {
        var url="{:URL('home/Coupon/toUserInfo',$_GET)}";
        url=url+"&extend=1";
        location.href=url;
    })
</script>
